Example: Run the Batch Processor (InsuranceFraudScore)

Example: Run the Batch Processor (InsuranceFraudScore)

The following example demonstrates how to run the Oracle Policy Automation Batch Processor. It reads in csv files as input, and writes the results out as csv files.

You can find the data (csv) files and the configuration file for this example at examples/determinations-batch/InsuranceFraudScore in the Oracle Policy Automation Runtime package.

Run the Batch Processor

  1. Open a command prompt and go to the examples/determinations-batch/InsuranceFraudScore.
  2. From the command line execute the Batch Processor - this is slightly different for Java or .NET:

    JAVA:
    java -jar ../../../engine/determinations-batch.jar --config fraud_score_config.xml

    .NET
    ..\..\..\engine\Determinations.Batch.exe --config fraud_score_config.xml

    The Batch Processor will run, executing across the data files in the csv directory. It will write the results to the output directory.

Look at the Batch Processor results

The Batch Processor results are written to the output directory where you should find the same two files as in the csv (input) directory:

 

The output file global.csv has the values inferred by the Batch Processor written to the following fields:

 

For example:

The first five columns of global.csv are the id row, "#", followed by four rows where output has been written (indicated by the braces, but also defined in the fraud_score_config.xml):

#,(total_fraud_score),(total_fraud_score_green),(total_fraud_score_amber),(total_fraud_score_red),...

For case number 1 (the first row in global.csv), the following has been written to the output files.

1,560,false,false,true,...

Total_fraud_score = 560

Total_fraud_score_green = false

Total_fraud_score_amber = false

Total_fraud_score_red = true

 

So, for this case, the total fraud score is 560, giving it a "red" (high risk status).

The other fields in this csv file are the inputs, which have been copied across from the input global.csv file. An output file contains the inferred outputs as well as the original input values.

Look at the Batch Processor inputs

Now that you have seen the output files, it is worth looking at the original input files in the csv directory to see what has changed.

global.csv

Each row in global.csv represents a global entity instance, which corresponds to a separate case. Each row in this file is processed as a case and written to the output file. Each column in the csv file represents an attribute for the entity global.

previous_claim.csv

Look at the configuration file

The purpose of a Batch Processor configuration file is to map input data to rulebase data, and also to specify the inputs outputs and batch run parameters.

Options

Options can be set in a configuration file or on the command line. The configuration file for the InsuranceFraudScore batch process sets parameters such as:

<options>
    <csv>csv</csv>
    <output type="csv">output</output>
    <processors>1</processors>
    <rulebase>../examples/rulebases/compiled/InsuranceFraudScore.zip</rulebase>
</options>

Mappings

Mappings define how the input data will be mapped to Oracle Policy Automation data. For the InsuranceFraudScore batch process there are mappings for two entities:

 

For both of these entities there is a mapping for each attribute which references the Oracle Policy Automation attribute, the row which contains the value, and whether it is an an output value. As well as defining attributes, the relationship between global and previous_claim is defined as follows:

<relationship name="previous_claims" source-entity="global" rel-source="global" foreign-key="case_fk"/>

This element in the previous_claim mapping allows the batch processor to associate previous_claim instances with a global instance by the foreign key reference in the column "case_fk"